home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / Binding / BindngH.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  7.7 KB  |  227 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        BindngH.h
  3.  
  4.     Contains:    Class definition for Binding helper object
  5.  
  6.     Owned by:    Caia Grisar 
  7.  
  8.     Copyright:    © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <5>      10/10/96    RA        Moved ChangeKindAndEditor, ChangeEditor,
  13.                                     IsNoPart and GetCurrentEditorForPart to
  14.                                     BindingUtils.h
  15.          <4>     6/27/96    RA        1343748: Added fSelf to BindingH.h so
  16.                                     Binding can call back to ODBinding
  17.          <3>     6/21/96    RA        1360591: Changed viewer NS type from object
  18.                                     to value
  19.          <2>      1/8/96    CG        1299331 1.0.1: Substitution warning dlg
  20.                                     nolonger displayed in background.
  21.          <5>     8/30/95    CG        #1244563 FB1:Missing editor needs
  22.                                     explanatory alert
  23.                                     #1215054 FB: Too many substitute editor
  24.                                     dialogs
  25.          <4>     6/16/95    CC        1259719: Added ChangeEditor and
  26.                                     ChangeKindAndEditor.
  27.          <3>     5/18/95    CG        #1249263 BB: BndNSUtl.cpp does not compile
  28.                                     standalone.
  29.          <2>     4/27/95    CC        1243813: Removed ShowAlert and
  30.                                     BindingDialogFilter; replaced by ShowAlert
  31.                                     in DlogUtil.
  32.          <1>     4/13/95    CG        first checked in
  33.          <8>    12/13/94    CG        #1193522: Added Binding Alert.
  34.          <7>     8/24/94    CG        #1181622: Updated ownership info.
  35.          <6>     8/17/94    CG        #1181440: ViewNameSpace now return
  36.                                     ODObjectNameSpace.  Made methods
  37.                                     nonvirtual.
  38.          <5>     7/29/94    CG        NameSpace API changes.
  39.          <4>     7/26/94    jpa        Don't inherit from ODObject.
  40.          <3>     6/27/94    CG        Moved IsEditorLoaded here from Prefs,
  41.                                     Removed fEv
  42.          <2>     6/23/94    eeh        remove EditorSet and ODEditorSetIterator
  43.          <1>     6/15/94    CG        first checked in
  44.          <1>      6/1/94    CG        first checked in
  45.         <14>     5/27/94    CG        #1165186: Abstracted out preferences from
  46.                                     Binding object.
  47.         <13>     4/13/94    TÇ        #1147222: Fix the View As popup in the Part
  48.                                     Frame Info dialog.  Also fix the Category
  49.                                     text, and the Kind & Editor popups to show
  50.                                     the current kind & editor respectively.
  51.                                     Made one method public for PtFrInfo.cpp to
  52.                                     use.
  53.         <12>      4/4/94    CC        GetKindsSupported() and
  54.                                     GetCategoriesOfKind() return ODTypeList
  55.                                     (1153046).
  56.         <11>     3/26/94    NP        1152831. Move private functions here.
  57.         <10>     3/23/94    CG        Added VerifyPrefFileVersion() and
  58.                                     UpdatePrefFileVersion() private methods.
  59.          <9>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  60.                                     #1150864.
  61.          <8>     3/14/94    CC        Added GetCurrentEditorForPart() (#1150376);
  62.                                     Made EditorSupportsKind() and
  63.                                     GetKindsSupported() public for
  64.                                     LinkDlgs.cpp.
  65.          <7>     3/11/94    CG        Bug # 1150204 - NMAPs are now loaded
  66.                                     whenever mod date of registered library
  67.                                     folder changes.
  68.          <6>     2/17/94    eeh        bug #1143340: made various private methods
  69.                                     public (to call from EdPrfInf.cpp)
  70.          <5>      2/3/94    CG        Added fHeap field.
  71.          <4>     1/12/94    CG        Removed ODCategorySet.
  72.          <3>    12/16/93    TÇ        moved typedef of ODEditor to PlfmType.h
  73.          <2>    12/10/93    CG        Added ASLM class id definition for the
  74.                                     ODBinding object.
  75.          <1>     11/7/93    TÇ        first checked in
  76.     To Do:
  77. */
  78.  
  79. #ifndef _BINDNGH_
  80. #define _BINDNGH_
  81.  
  82. #ifndef _PLFMDEF_
  83. #include "PlfmDef.h"
  84. #endif
  85.  
  86. #ifndef _ODOBJ_
  87. #include "ODObject.xh"
  88. #endif
  89.  
  90. #ifndef _ODTYPES_
  91. #include "ODTypes.h"
  92. #endif
  93.  
  94. //=====================================================================================
  95. // Theory of Operation
  96. //=====================================================================================
  97.  
  98. /*
  99.     This file describes the ODBinding class. 
  100.     ODBinding is a system service that is used to bind part data to part editors.
  101.     ODBinding also includes a number of utility functions, including mapping content
  102.     kinds to categories, providing a list of part editors supporting a given kind, and 
  103.     routines to access and set system-wide editor preferences.
  104. */
  105.  
  106.  
  107. //=====================================================================================
  108. // Classes defined in this interface
  109. //=====================================================================================
  110. class Binding;
  111.  
  112. //=====================================================================================
  113. // Classes used by this interface
  114. //=====================================================================================
  115. class ODStorageUnit;
  116. class ODDraft;
  117. class ODTypeList;
  118. class ODSession;
  119. class ODObjectNameSpace;
  120. class ODNameSpaceManager;
  121. class ODValueNameSpace;
  122. class OrderedCollection;
  123. class OrderedCollectionIterator;
  124. class ODFile;
  125. class EditorSet;
  126. class ODPart;
  127. class ODBinding;
  128.  
  129. //=====================================================================================
  130. // Class Binding
  131. //=====================================================================================
  132.  
  133. class Binding
  134. {
  135. public:
  136.     
  137.     Binding();
  138.     
  139.         // ODSession creates one instance of Binding
  140.         // which is then shared among clients within the process.
  141.         
  142.     ODVMethod ~Binding();
  143.     
  144.     ODNVMethod void InitBinding(ODSession* session);
  145.                   
  146.     ODNVMethod ODSize Purge(ODSize size);
  147.     
  148.     //---------------------------------
  149.     // Direct editor bindings
  150.  
  151.     ODNVMethod ODEditor ChooseEditorForPart(ODStorageUnit* thePartSU, ODType newKind );
  152.         // Returns the "best" available editor for the part
  153.         // may invoke automatic translation
  154.  
  155.     ODNVMethod ODEditor TranslateAndChooseEditorForPart(ODStorageUnit* thePartSU);
  156.         // attempt to intelligently translate one of the kinds in the part into 
  157.         // a kind which an available editor supports, and return that editor
  158.  
  159.     //---------------------------------
  160.     // Editor related utility methods
  161.  
  162.     ODNVMethod ODTypeList* GetKindsSupported(ODEditor editor);
  163.         // Returns the set of data types supported (without translation) by the
  164.         // argument editor.
  165.  
  166.     ODNVMethod ODContainerSuite GetContainerSuite(ODContainerType containerType);
  167.     
  168.     ODNVMethod ODBoolean EditorExists(ODEditor editor);
  169.         // Returns true if the argument editor is present on this machine.
  170.         
  171.     ODNVMethod ODBoolean    IsEditorLoaded(ODEditor editor);
  172. private:
  173.  
  174.     ODNVMethod ODEditor ChooseDirectEditorForPart(ODStorageUnit* thePartSU, ODType newKind );
  175.         // Returns the "best" available editor for the part
  176.         // without translation.
  177.     
  178.     ODNVMethod ODEditor ChooseDirectEditorForKind(ODType aKind, ODStorageUnit* thePartSU);
  179.         // Returns the "best" available editor which supports kind aKind of the part
  180.         // without translation.
  181.  
  182.     //---------------------------------
  183.     // Editor related utility methods
  184.  
  185.     ODNVMethod ODEditor GetPreferredEditorForPart(ODStorageUnit* thePartSU, ODBoolean* noPrefEditor);
  186.         // Returns the editor that last externalized the argument storage unit.
  187.         // Null is returned if that editor is not present on the current machine.
  188.         // noPrefEditor is set to true if no kODPropPreferredEditor property exists in the SU
  189.  
  190.     ODNVMethod ODEditor AlphaNumChooseEditor(EditorSet* editorSet);
  191.         // Returns the (alphanum preferred editor over viewer) from 
  192.         // the set of Editors
  193.         
  194.     ODNVMethod ODEditor AlphaNumChooseAnEditorFromTwo(ODEditor e1, ODEditor e2);
  195.         // Returns the (alphanum preferred editor over viewer) of the two editors
  196.         
  197.     ODNVMethod ODBoolean DraftRestrictsEditors(ODDraft* draft);
  198.         // Returns true if the argument draft restricts the editors that may be
  199.         // used in this document.
  200.  
  201.     ODNVMethod EditorSet* GetAllRestrictedEditorsForKind(ODDraft* draft, ODType kind);
  202.         // returns subset of restricted editors of draft which support kind.
  203.         
  204.     //---------------------------------
  205.     // Category and kind mappings
  206.  
  207.     ODNVMethod ODValueNameSpace*        ViewerNameSpace();
  208.  
  209.     //---------------------------------
  210.     // Alert Utilities
  211.     ODNVMethod void SubstitutionWarning(ODEditor theEditor, ODStorageUnit* thePartSU);
  212.  
  213.     ODNVMethod ODBoolean NotifiedSubstitutions(ODEditor theEditor, 
  214.                                                             ODISOStr theCategory);
  215.     
  216.  
  217. // Fields:
  218.  
  219.     ODSession*             fSession;
  220.     ODValueNameSpace*    fSubstitutionList;
  221.     NMUPP                fNMResponseUPP;
  222.     NMRecPtr            fNMRecPtr;
  223.     ODBinding*            fSelf;
  224. };
  225.  
  226.  
  227. #endif // _BINDNGH_